<script>
    function marks(id){
        var answer = confirm("Bạn có chắc chắn muốn xóa không?")
        if (answer){
            window.location = "<?php echo $this->baseUrl(); ?>/administrator/contest/delete/id/"+id;
        }

        return false;

    }
</script>
<article class="module width_full">
    <header>
        <h3 class="tabs_involved">Quản lý bài dự thi</h3>

    </header>
    <div class="module_content">
        <table cellspacing="0" class="tablesorter tablesorterBorder">
            <thead>
                <tr>
                    <th width="15">STT</th>
                    <th width="80">Username</th>
                    <th width="530">Trạng thái</th>
                    <th>Tình trạng</th>
                    <th>Điều khiển</th>		

                </tr>
            </thead>
            <?php foreach($this->data as $key=>$value):
                    $class = null;
                    if ($key % 2 == 0) {
                        $class = ' class="altrow"';
                    }
                ?> 
                <tr <?php echo $class;?>>
                    <td><?php echo $key + 1;?></td>
                    <td><div style="width: 80px; word-wrap: break-word;"> <?php echo $value['user_post'] == "none" ? $value['user_name'] : $value['user_post']; ?></div></td>
                    <td><?php echo $this->Substring($value['content'], 1000);?></td>
                    <td><?php echo $value['status'];?></td>
                    <td><a onclick="marks('<?php echo $value['id'];?>')">Xóa</a> </td>		

                </tr>    
                <?php endforeach; ?>

        </table>
    </div>


    <div class="paging">
        <?php echo $this->paginationControl($this->data, 'Sliding', 'pagination.phtml'); ?>
    </div>
</article>